Repository navigation
接入 C++ C# Lua Luau 语法候选资产 - #22
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e40a81f9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "grammar_repository": {"type": "string", "pattern": "^https://github.com/tree-sitter/tree-sitter-"}, | ||
| "language": {"enum": ["arkts", "c", "cfml", "cfquery", "cfscript", "cobol", "cpp", "csharp", "dart", "erlang", "go", "java", "javascript", "kotlin", "lua", "luau", "nix", "objc", "pascal", "php", "python", "r", "ruby", "rust", "scala", "solidity", "swift", "terraform", "tsx", "typescript", "vbnet", "zig"]}, | ||
| "dialect": {"type": "string", "minLength": 1}, | ||
| "loader_symbol": {"const": "c_sharp"}, |
There was a problem hiding this comment.
Require the C# loader symbol conditionally
For a csharp asset, omitting loader_symbol still passes this published schema because the property is not required; conversely, any other language may supply "loader_symbol": "c_sharp". The Rust manifest reader rejects both shapes, so schema-only validation can approve a manifest that the worker cannot load. Add a language-dependent condition that requires this field only when language is csharp and forbids it otherwise.
Useful? React with 👍 / 👎.
| "sha256": {"$ref": "#/$defs/sha256"}, | ||
| "bytes": {"type": "integer", "minimum": 8, "maximum": 8388608}, | ||
| "license": {"enum": ["java/LICENSE", "python/LICENSE", "typescript/LICENSE"]}, | ||
| "bytes": {"type": "integer", "minimum": 8, "maximum": 33554432}, |
There was a problem hiding this comment.
Keep the schema size limit aligned with the WASM loader
Assets between 8 MiB and 32 MiB now pass this schema while also being required to claim codeguard_runtime_validation: rust_loader_smoke_passed, but WasmGrammar::load unconditionally rejects inputs over 8 MiB. A schema consumer can therefore approve an impossible runtime-validation claim—for example, the documented 16.4 MB COBOL asset. Retain the 8 MiB maximum until the runtime limit is raised.
Useful? React with 👍 / 👎.
问题与结果
CodeGraph 随仓的 C++、C#、Lua、Luau WASM 尚未进入 CodeGuard 固定资产清单。此变更固定四份原始字节、上游标签提交、许可证和真实 ABI,并接入 Rust 隔离 worker。C# 的公开语言 ID
csharp与 WASM 导出符号c_sharp分开固定,篡改符号声明会被拒绝。候选清单的 JSON Schema 原先只接受四份资产,已经不能验证当前内容;现在与当前封闭字段、依赖包元数据和 32 种目标语言保持一致,并增加清单与 schema 同步的回归测试。只读
grammar status报告 32 种来源、15 份未验收候选、0 项已发行。基础正反语法样例可区分,但 C++ 宏/模板、C# 预处理和 Lua/Luau 方言尚无完整语料与原生对照;候选观察保持incomplete,没有公开 lint 路由或交付权威。验证
incomplete、grammar_qualified=false。cargo test --locked --workspace --all-features:182 组、1136 通过、0 失败、106 条有条件忽略。后续 schema 修正的定向测试 6/6 通过,更新后整轮由 PRgate复核。cargo clippy --locked --workspace --all-targets --all-features -- -D warnings、cargo fmt --all -- --check、OpenSpec strict 校验通过。jsonschema4.25.1 按 Draft 2020-12 验证当前 15 份清单通过,伪造发布状态和错误 C# 符号均被拒绝。OpenSpec 14.19 仍未完成;剩余 17 种资产、逐语言误报评测、原生优先路由与发行验收待实施。